﻿#include <stdio.h>

char* GetMemory(void)
{
	//局部数组 栈区
	static char p[] = "Hello Ablone"; //哈喽 鲍⻥
	return p;
}
int main()
{
	char *str = NULL;
	str = GetMemory();
	printf(str);
	return 0;
}

/*
int fun(int x, int y)
{
	static int m = 0;
	static int i = 2;
	i += m + 1;
	m = i + x + y;
	return m;
}
void main()
{
	int j = 4;
	int m = 1;
	int k;
	k = fun(j, m);//8
	printf("%d\n", k);
	k = fun(j, m);
	printf("%d\n", k);//17;
	return;
}


/*
//引入外部变量
//extern int global = 100;

void fun(){
	static int value = 0;	//静态局部变量 - 具有记忆性；限定了变量的文件作用域
	value++;
	printf("value = %d\n", value);
}

int main(){
	for (int i = 0; i < 10; ++i)
		fun();
	return 0;
}

/*
void fun(){
	static int value = 0;	//静态局部变量 - 具有记忆性
	value++;
	printf("value = %d\n", value);
}

int main(){
	for (int i = 0; i < 10; ++i)
		fun();
	return 0;
}
*/